package com.example.designer.abstractfactory.factory;

import com.example.designer.abstractfactory.Factory;

/**
 * 获取具体工厂实例
 */
public class FactoryProducer {
    public static Factory getFactory(String type) {
        switch (type){
            case "CAR":
                return new CarFactory();
            case "COLOR":
                return new ColorFactory();
            default:
                return null;
        }
    }
}
